﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SpectrumAnalyser.Controls.BusyIndicator
{
    /// <summary>
    /// Interaction logic for BusyIndicatorWindow.xaml
    /// </summary>
    public partial class BusyIndicatorWindow : Window
    {
        public BusyIndicatorWindow()
        {
            InitializeComponent();
            //BusyIndicator.IsBusy = true;
        }

        public static void Instance()
        {
            Thread newWindowThread = new Thread(new ThreadStart(ThreadStartingPoint));
            newWindowThread.SetApartmentState(ApartmentState.STA);
            newWindowThread.IsBackground = true;
            newWindowThread.Start();
        }

        private static void ThreadStartingPoint()
        {
            BusyIndicatorWindow window = new BusyIndicatorWindow();
            window.Show();
            System.Windows.Threading.Dispatcher.Run();
        }
    }
}
